  <?php 
       include("../common/conn.php");

$nodes = array();
fetch_all($thesymptom);
// -----------------------------

class Node{
    public $id;
    public $pId;
    public $name;
    public $kuaidiyuan;
    public $phone;
    public $address;
    
    public function __construct($id, $pId, $name, $kuaidiyuan, $phone,$address){
        $this->id = $id;
        $this->pId = $pId;
        $this->name = $name;
        $this->kuaidiyuan = $kuaidiyuan;
        $this->phone = $phone;
        $this->address = $address;
    }
}

function fetch_all($thesymptom){
    global $nodes;
    $result = mysql_query("SELECT  * FROM   `quyu_kuai`  WHERE  pid=".$_REQUEST['pid']);
     while($row = mysql_fetch_assoc($result)){
        $node_item = new Node($row[id], $row[pid] , $row[district], $row[kuaidiyuan], $row[phone], $row[address]);
        $nodes[] = $node_item;
     }
   echo json_encode($nodes); 
}
?>